home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 March / EnigmA AMIGA RUN 05 (1996)(G.R. Edizioni)(IT)[!][issue 1996-03][Skylink CD IV].iso / earcd / program / ixemlsrc.lha / ixemul / library / hwck.c < prev    next >
C/C++ Source or Header  |  1996-01-03  |  2KB  |  82 lines

  1. /*
  2.  *  This file is part of ixemul.library for the Amiga.
  3.  *  Copyright (C) 1994  Rafael W. Luebbert
  4.  *
  5.  *  This library is free software; you can redistribute it and/or
  6.  *  modify it under the terms of the GNU Library General Public
  7.  *  License as published by the Free Software Foundation; either
  8.  *  version 2 of the License, or (at your option) any later version.
  9.  *
  10.  *  This library is distributed in the hope that it will be useful,
  11.  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  13.  *  Library General Public License for more details.
  14.  *
  15.  *  You should have received a copy of the GNU Library General Public
  16.  *  License along with this library; if not, write to the Free
  17.  *  Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18.  *
  19.  *  $Id: hwck.c,v 1.3 1994/10/18 09:12:51 rluebbert Exp $
  20.  *
  21.  *  $Log: hwck.c,v $
  22.  * Revision 1.3  1994/10/18  09:12:51  rluebbert
  23.  * Check for math emulation code (881 || 882) in 040s.  Assume no FPU otherwise.
  24.  * No 040 FPU instruction support yet.
  25.  *
  26.  * Revision 1.2  1994/06/22  14:56:04  rluebbert
  27.  * added struct ExecBase **4
  28.  *
  29.  * Revision 1.1  1994/06/19  15:11:39  rluebbert
  30.  * Initial revision
  31.  *
  32.  */
  33.  
  34. #include <exec/execbase.h>
  35.  
  36. int check_hardware (void)
  37. {
  38.   struct ExecBase *sysbase = *(struct ExecBase **)4;
  39.  
  40. #if defined (mc68020) || defined (mc68030) || defined (mc68040) || defined (mc68060)
  41.   if ((sysbase->AttnFlags & AFF_68020) || (sysbase->AttnFlags & AFF_68030) ||
  42.     (sysbase->AttnFlags & AFF_68040));
  43.   else
  44.     {
  45.       ix_panic("This ixemul version requires a 68020/30/40.");
  46.       return 0;
  47.     }
  48. #endif
  49. #ifdef __HAVE_68881__
  50.   if ((sysbase->AttnFlags & AFF_68881) || (sysbase->AttnFlags & AFF_68882))
  51.     ;
  52.   else
  53.     {
  54.       if (sysbase->AttnFlags & AFF_68040)
  55.     ix_panic("68040 math emulation code not found.");
  56.       else
  57.     ix_panic("This ixemul version requires an FPU.");
  58.       return 0;
  59.     }
  60. #endif
  61.   return 1;
  62. }
  63.  
  64. int betterthan68000(void)
  65. {
  66.   struct ExecBase *sysbase = *(struct ExecBase **)4;
  67.  
  68.   if ((sysbase->AttnFlags & AFF_68020) || (sysbase->AttnFlags & AFF_68030) ||
  69.     (sysbase->AttnFlags & AFF_68040))
  70.     return 1;
  71.   return 0;
  72. }
  73.  
  74. int gotanfpu(void)
  75. {
  76.   struct ExecBase *sysbase = *(struct ExecBase **)4;
  77.  
  78.   if ((sysbase->AttnFlags & AFF_68881) || (sysbase->AttnFlags & AFF_68882))
  79.     return 1;
  80.   return 0;
  81. }
  82.